package com.yipingtai.api;


import com.yipingtai.config.FeignConfig;
import com.yipingtai.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 定义访问用户微服务的feign的客户端
 */
@FeignClient(value = "userservice",configuration = {FeignConfig.class})
public interface UserClient {
    @GetMapping("/user/{id}")
    User findById(@PathVariable("id") Long id);

    @GetMapping("/user/getUser")
    User getUser(@RequestParam("name") String name,@RequestParam("address") String address);
}
